package cn.wit.luohui.day09;

import org.junit.Test;

import cn.wit.luohui.day05.Employee;

//运行时异常
public class DemoRuntimeException {
public static void main(String[] args) {
	String s=null;
	
	// 判断s是不是null
	if(s!=null) {
		s.charAt(0);
		//System.out.println();
	}
}
@Test
public void test2() {
	Employee e = new Employee("Boss", 18);
	
	//Manager m = (Manager) e;
}
//数组越界
@Test
public void test3() {
	int[] array = {2, 3};
	
	System.out.println(array[2]);
}
//下标越界
	@Test
	public void test4() {
		String s = "abb";
		
		System.out.println(s.charAt(3));
	}
	// 除0异常,被除数不能为0
		@Test
		public void test5() {
			int j = 0;
			int i = 10 / j;
		}
}
